from datetime import datetime, timedelta

# 定义 2024 年的起始日期和结束日期
start_date = datetime(2022, 1, 1)
end_date = datetime(2022, 12, 31)

sunzi = []  # 顺子
for i in range(0,8):
    sunzi.append(f"{i}{i+1}{i+2}")
def isValid(strs):
    for s in sunzi:
        if s in strs:
            return True
    return False
    
# 循环输出每一天
result = 0
current_date = start_date
while current_date <= end_date:
    if isValid(current_date.strftime("%Y%m%d")):
        result += 1
        print(current_date.strftime("%Y%m%d"))
    current_date += timedelta(days=1)  # 增加一天

print(result)

